﻿<UserControl x:Class="WMSSoft.WinKStart.UserControls.ModulesDataSource"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="280" d:DesignWidth="454">
    <WrapPanel Margin="5" Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" Visibility="Visible">
        <ListView x:Name="lv_DataSources" Height="234" Width="452" VerticalContentAlignment="Center" ItemsSource="{Binding Data}" SelectedItem="{Binding SelectedItem}">
            <ListView.ContextMenu>
                <ContextMenu>
                    <MenuItem Header="Add" IsEnabled="True"/>
                    <MenuItem Header="Edit" IsEnabled="False"/>
                    <MenuItem Header="Delete" IsEnabled="False"/>
                    <MenuItem Header="View Data" IsEnabled="False"/>
                    <MenuItem Header="Reload Data" IsEnabled="False"/>
                </ContextMenu>
            </ListView.ContextMenu>
            <ListView.View>
                <GridView>
                    <GridViewColumn Header="Caption" DisplayMemberBinding="{Binding ShortName}" Width="100"/>
                    <GridViewColumn Header="Name  " DisplayMemberBinding="{Binding Name}" Width="200" />
                    <GridViewColumn Header="Assembly  " DisplayMemberBinding="{Binding Assembly}" Width="300"/>
                </GridView>
            </ListView.View>
        </ListView>
        <Button Content="{Binding Cmd_AddClick.ViewName}" Height="23" Width="100" Margin="10,8,0,0" Command="{Binding Cmd_AddClick.Command}" CommandParameter="{Binding ElementName=lv_DataSources}"/>
        <Button Content="{Binding Cmd_EditClick.ViewName}" Height="23" Width="100" Margin="10,8,0,0" IsEnabled="{Binding DataSourceSelected}" Command="{Binding Cmd_EditClick.Command}" CommandParameter="{Binding ElementName=lv_DataSources}"/>
        <Button Content="{Binding Cmd_DeleteClick.ViewName}" Width="100" Height="23" Margin="10,8,0,0" IsEnabled="{Binding DataSourceSelected}" Command="{Binding Cmd_DeleteClick.Command}" CommandParameter="{Binding ElementName=lv_DataSources}"/>
        <Button Content="{Binding Cmd_ViewDataClick.ViewName}" Width="100" Height="23" Margin="10,8,0,0"  IsEnabled="{Binding DataSourceSelected}" Command="{Binding Cmd_ViewDataClick.Command}" CommandParameter="{Binding ElementName=lv_DataSources}"/>
    </WrapPanel>
</UserControl>
